﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    
    <title>添加角色</title>  
    <!--引入文件-->
    <link href="~/Content/themes/default/easyui.css" rel="stylesheet" />
    <link href="~/Content/themes/icon.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-1.8.2.min.js"></script>
    <script src="~/Scripts/jquery.easyui.min.js"></script>
    <script src="~/Scripts/easyui-lang-zh_CN.js"></script>
    <script src="~/Scripts/datapattern.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
    <script src="~/Scripts/jquery.validate.min.js"></script>
    <link href="~/Content/BaseStyle.css" rel="stylesheet" />
    <script type="text/javascript">
        //获取url中的参数
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return unescape(r[2]); return null; //返回参数值
        }
        $(function () {
            console.log(getUrlParam("ObjectId"));
            $('#ObjectId').val(getUrlParam("ObjectId"));
        });

        function subForm() {
            console.log("subForm--提交数据")
            $("#fmMain").submit();
        }
        function afterAdd(data) {
            console.log("sub-after-add:" + data);
            //调用父窗体中的方法
            window.parent.afterAdd(data);
        }
    </script>
</head>
<body>
   
        @using (Ajax.BeginForm("AddRoleInfo", "RoleInfo", new { },
        new AjaxOptions() { HttpMethod = "post", OnSuccess = "afterAdd" },
        new { id = "fmMain" }))
{
             @Html.AntiForgeryToken()
                @Html.ValidationSummary(true)
                <input type="hidden" id="ObjectId" name="ObjectId" />
              <table>
                <tr><td>角色名称：</td><td><input type="text" name="RoleName" /></td></tr>                
                <tr><td>备注：</td><td><input type="text" name="Remark" /></td></tr>
                <tr><td>排序：</td><td><input type="text" name="Sort" /></td></tr>
            </table>
    
    }
    
   
</body>
</html>
